Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

string-collapse-leading-whitespace

Package Overview
Dependencies
Maintainers
1
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string-collapse-leading-whitespace

Collapse the leading and trailing whitespace of a string

  • 7.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
159K
decreased by-2.46%
Maintainers
1
Weekly downloads
 
Created

What is string-collapse-leading-whitespace?

The string-collapse-leading-whitespace npm package is designed to collapse leading whitespace in strings. This can be particularly useful for cleaning up user input, formatting text, or preparing strings for further processing.

What are string-collapse-leading-whitespace's main functionalities?

Collapse Leading Whitespace

This feature removes leading whitespace from the input string. In the example, the leading spaces before 'Hello World!' are removed.

const collapseLeadingWhitespace = require('string-collapse-leading-whitespace');
const result = collapseLeadingWhitespace('   Hello World!');
console.log(result); // 'Hello World!'

Collapse Leading and Trailing Whitespace

This feature removes both leading and trailing whitespace from the input string. In the example, the spaces before and after 'Hello World!' are removed.

const collapseLeadingWhitespace = require('string-collapse-leading-whitespace');
const result = collapseLeadingWhitespace('   Hello World!   ');
console.log(result); // 'Hello World!'

Other packages similar to string-collapse-leading-whitespace

Keywords

FAQs

Package last updated on 05 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc